package com.rzx.mybackend.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.rzx.mybackend.common.PageResult;
import com.rzx.mybackend.dto.BuyMerchandiseDTO;
import com.rzx.mybackend.dto.MerchandisePageDTO;
import com.rzx.mybackend.entity.Merchandise;

import java.util.Map;

/**
 * MerchandiseService
 *
 * @author renzhexian
 * @date 2025/8/13
 */

public interface MerchandiseService extends IService<Merchandise> {

    PageResult<Merchandise> page(MerchandisePageDTO merchandisePageDTO);

    /**
     * 扣减库存
     * @param merchandiseId
     * @param totalQuantity
     */
    void releaseStock(Long merchandiseId, int totalQuantity);

    /**
     * 退款库存
     * @param merchandiseId
     * @param integer
     */
    void refundStock(Long merchandiseId, Integer integer);
}
